<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:noNamespaceSchemaLocation="amzn-envelope.xsd"><#if header??>
    <Header><#if header.documentVersion??>
        <DocumentVersion>${header.documentVersion}</DocumentVersion>
    </#if><#if header.merchantIdentifier??>
        <MerchantIdentifier>${header.merchantIdentifier}</MerchantIdentifier>
    </#if><#if header.overrideReleaseId??>
        <OverrideReleaseId>${header.overrideReleaseId}</OverrideReleaseId>
    </#if>
    </Header>
    </#if>
    <MessageType>${messageType.value()}</MessageType><#if purgeAndReplace?? && purgeAndReplace>
    <PurgeAndReplace>${purgeAndReplace?c}</PurgeAndReplace>
    </#if><#if effectiveDate??>
    <EffectiveDate>${effectiveDate?datetime?iso_local}</EffectiveDate></#if>
    <#list message as msg>
    <Message>
        <MessageID>${msg.messageId?c}</MessageID><#if msg.operationType??>
        <OperationType>${msg.operationType}</OperationType></#if><#if msg.content??>
        <CartonContentsRequest>
            <ShipmentId>${msg.content.shipmentId?xml}</ShipmentId>
            <NumCartons>${msg.content.numCartons}</NumCartons>
            <#list msg.content.carton as carton>
            <Carton>
                <CartonId>${carton.cartonId}</CartonId>
                <#list carton.item as item>
                <Item>
                    <SKU>${item.sku?xml}</SKU>
                    <QuantityShipped>${item.quantityShipped?c}</QuantityShipped><#if item.quantityInCase?? && item.quantityInCase &gt; 0>
                    <QuantityInCase>${item.quantityInCase?c}</QuantityInCase><#else>
                    <QuantityInCase>1</QuantityInCase></#if><#if item.expirationDate??>
                    <ExpirationDate>${item.expirationDate?date?iso_local}</ExpirationDate></#if>
                </Item>
                </#list>
            </Carton>
            </#list>
        </CartonContentsRequest></#if>
    </Message>
    </#list>
</AmazonEnvelope>